﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using WDutils;

namespace WD.Classes
{
    public class ActivityLog : BasicObject
    {
        public static string ACTIVITY_LOG_ID = "id";
        public static string ACTIVITY_LOG_CREATED_ON = "created_on";
        public static string ACTIVITY_LOG_MODIFIED_ON = "modified_on";
        public static string ACTIVITY_LOG_DELETED_ON = "deleted_on";
        
        public ActivityLog() { }

        public ActivityLog(DataRow dataRow)
        {
            this.setID(dataRow[ACTIVITY_LOG_ID].ToString());
            this.setCreatedOn(long.Parse(dataRow[ACTIVITY_LOG_CREATED_ON].ToString()));
            this.setModifiedOn(long.Parse(dataRow[ACTIVITY_LOG_MODIFIED_ON].ToString()));
            if (dataRow[ACTIVITY_LOG_DELETED_ON].ToString() != "") this.setDeletedOn(long.Parse(dataRow[ACTIVITY_LOG_DELETED_ON].ToString()));
            this.setText(dataRow[Properties.Settings.Default.ACTIVITY_LOG_ATTRIB_TEXT].ToString());
        }

        public string getID()
        {
            return this.dictData[ACTIVITY_LOG_ID];
        }
        public void setID(string strValue)
        {
            this.dictData[ACTIVITY_LOG_ID] = Utils.Data._sql(strValue);
        }

        public string getText()
        {
            return this.dictData[Properties.Settings.Default.ACTIVITY_LOG_ATTRIB_TEXT];
        }
        public void setText(string strValue)
        {
            this.dictData[Properties.Settings.Default.ACTIVITY_LOG_ATTRIB_TEXT] = Utils.Data._sql(strValue);
        }
    }
}
